package 数学;

import java.util.Scanner;

public class 快速幂 {
	public static void main(String[] args) {
		var sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		// 表示的是n的m次方
		int ret = ksm(n, m);
		System.out.print(ret + "\n");
	}
	public static int ksm(int n, int m) {
		int ret = 1;
		while(m != 0 ) {
			if((m & 1) != 0 ) {
				ret *= n;
			}
			n = n * n;`
			m >>= 1;
		}
		return ret;
	}
}
